package cn.pconline.autoclub.util.ubb.node;

import cn.pconline.autoclub.util.ubb.EscapeUtils;
import cn.pconline.autoclub.util.ubb.Node;

/**
 *
 * @author xhchen
 */
public class QuoteNode extends AbstractNode {

	public QuoteNode() {}

	private QuoteNode(String name, String attribute) {
		super.name = name;
		super.attribute = attribute;
	}

	@Override
	public StringBuilder getText(java.util.LinkedList<Node> stack) {
		StringBuilder sb = new StringBuilder();
        sb.append("<span class=\"cite\"><span class=\"cite_sign cite_sign_l\"><img src=\"http://bbs.pcauto.com.cn/images/lquote.png\"></span>")
        .append(text)
        .append("<span class=\"cite_sign cite_sign_r\"><img src=\"http://bbs.pcauto.com.cn/images/rquote.png\"></span></span>\n");
        return sb;
	}

	@Override
	public void appendText(CharSequence text) {
		EscapeUtils.appendHtml(text, super.text);
	}

	@Override
	public Node copyWithoutText() {
		return new QuoteNode(name, attribute);
	}

	@Override
	public Node build(String name, String attribute) {
		return new QuoteNode(name, attribute);
	}

}
